package com.wyait.manage.interceptor;

import org.springframework.security.access.AccessDeniedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(value = AccessDeniedException.class)
    @ResponseBody
    public String accessDeniedExceptionHandler(Exception e){
		System.out.println("暂无权限访问！原因是:"+e);
		return "暂无权限访问";
    }
}